{% extends "admin/layout.jinja2" %}
{% block title %}{{ super() }}-admin{% endblock %}
{% block head_css %}
    {{ super() }}
    <link rel="stylesheet" type="text/css" href="/static/lib/zTreeStyle/zTreeStyle.css" />
    <link rel="stylesheet" type="text/css" href="/static/lib/responsive-tabs/css/style.css" />
    <link rel="stylesheet" type="text/css" href="/static/lib/wysihtml/css/stylesheet.css" />
    <link rel="stylesheet" type="text/css" href="/static/css/admin/index/sidebar-menu.css" />
    <link rel="stylesheet" type="text/css" href="/static/css/admin/index/main.css" />
{% endblock %}
{% block head_js %}
    {{ super() }}
    <script type="text/javascript">
        window.GLOBAL = {};
        GLOBAL.TREE_ID = '_tree_';
    </script>
{% endblock %}
{% block page_header %}
    {{ super() }}
{% endblock %}
{% block page_body %}
    {% include "admin/widgets/sidebar.jinja2" ignore missing with context %}
    <div id="main">
        <div id="main-tabs" class="c-tabs no-js">
            <div class="c-tabs-nav mian-tabs-link">
                <a href="javascript:;" class="c-tabs-nav__link is-active">文章/笔记-列表</a>
                <a href="javascript:;" class="c-tabs-nav__link">预&nbsp;览</a>
                <a href="javascript:;" class="c-tabs-nav__link">编&nbsp;辑</a>
            </div>
            <div class="main-tabs-content">
                <div class="c-tab is-active" id="tab-doc-list">
                    <div class="c-tab__content">
                        <div id="doc-list"></div>
                    </div>
                </div>
                <div class="c-tab" id="tab-perview">
                    <div class="c-tab__content">
                        <iframe id="doc-preview"></iframe>
                        <script type="text/plain" id="preview-css">
                            .content-wrapper {
                                padding: 1px;
                            }
                            body {
                                word-wrap: break-word;
                                /*white-space: pre-wrap;*/
                                word-break: break-all;
                            }
                        </script>
                        <script type="text/plain" id="preview-js">
                            var $ = parent.$;
                            console.log($);
                        </script>
                    </div>
                </div>
                <div class="c-tab" id="tab-editing">
                    <div class="c-tab__content">
                        <input type="text" id="doc-title" placeholder="标题" />
                        <button id="doc-save">保存</button>
                        <div id="editor-tabs" class="c-tabs no-js">
                            <div class="c-tabs-nav editor-tabs-link">
                                <a href="javascript:;" class="c-tabs-nav__link is-active">MarkDown</a>
                                <a href="javascript:;" class="c-tabs-nav__link">Html</a>
                            </div>
                            <div class="editor-tabs-content">
                                <div class="c-tab is-active" id="markdown-editor">
                                    <div class="c-tab__content">
                                        {% include "admin/widgets/markdown-editor.jinja2" ignore missing with context %}
                                    </div>
                                </div>
                                <div class="c-tab" id="html-editor">
                                    <div class="c-tab__content">
                                    {% include "admin/widgets/wysihtml-editor.jinja2" ignore missing with context %}
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
{% endblock %}
{% block page_footer %}
    {{ super() }}
{% endblock %}
{% block foot_js %}
    {{ super() }}
    <script type="text/javascript" src="/static/lib/jquery.ztree.all.min.js"></script>
    <script type="text/javascript" src="/static/lib/responsive-tabs/js/tabs.min.js"></script>
    <script type="text/javascript" src="/static/lib/wysihtml/js/wysihtml.min.js"></script>
    <script type="text/javascript" src="/static/lib/wysihtml/js/wysihtml.toolbar.min.js"></script>
    <script type="text/javascript" src="/static/lib/wysihtml/js/wysihtml.all-commands.min.js"></script>
    <script type="text/javascript" src="/static/lib/wysihtml/js/wysihtml.table_editing.min.js"></script>
    <script type="text/javascript" src="/static/lib/wysihtml/js/parser_rules/advanced_and_extended.js"></script>
    <script type="text/javascript" src="/static/js/admin/index/sidebar-tree.js"></script>
    <script type="text/javascript" src="/static/js/admin/index/sidebar-menu.js"></script>
    <script type="text/javascript" src="/static/js/admin/index/doc-list.js"></script>
    <script type="text/javascript" src="/static/js/admin/index/main.js"></script>
{% endblock %}